<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<ui:composition 
	  xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      template="/view/templates/templateLayout.xhtml">
      
      <ui:define name="conteudo">      	
  	  <link rel="stylesheet" type="text/css" href="./estilos.css"/>
  	  
<h:form id="formExcluirPlano" prependId="false">  
	<p:panel id="panelExcluirPlano" header="Excluir Plano" style="margin-bottom:20px; ">  
	<f:facet name="header">
		<h:outputText value="Excluir Plano" styleClass="outputTextTitulo"/>
	</f:facet>
 	<p:messages id="messagesExcluirPlano" autoUpdate="true" closable="true" /> 
    	<h:panelGrid id="pgPlano" columns="2" style="margin-top:20px; margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Plano*" styleClass="outputLabel"/>             
            <p:inputText value="#{planoBean.plano.idPlano}" styleClass="inputId" disabled="true"/>  
  			<p:inputText value="#{planoBean.plano.descricao}"  styleClass="inputDescricao" disabled="true"/>  
        </h:panelGrid> 
        <h:panelGrid id="pgPeriodo" columns="3" style="margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Período*" styleClass="outputLabel"/>  
            <h:outputLabel value="Meses*" styleClass="outputLabel"/> 
            <p:inputText value="#{planoBean.plano.periodo.idPeriodo}" styleClass="inputId" disabled="true"/>  
  			<p:inputText value="#{planoBean.plano.periodo.descricao}"  styleClass="inputDescricao" disabled="true"/>  
  			<p:inputText value="#{planoBean.plano.periodo.meses}" styleClass="inputId" disabled="true"/>
        </h:panelGrid>         
        <p:dataTable  id="tablePlanoModalidade" value="#{planoBean.arrayPlanoModalidade}" var="planoModalidade" style="margin-top:30px; width:40%"  
        				rowKey="#{planoModalidade}" selection="#{planoBean.planoModalidadeSelect}" >
			<p:column>
				<f:facet name="header">
					<h:outputText value="Modalidade" />
				</f:facet>
				<h:outputText value="#{planoModalidade.modalidade.descricao}" />
			</p:column>
			<p:column>
				<f:facet name="header">
					<h:outputText value="Valor" />
				</f:facet>
				<h:outputText value="#{planoModalidade.valor}" />
			</p:column>	
       	 	<f:facet name="footer" >
       	 		<h:outputText value="Total = R$ #{planoBean.plano.total}" >
       	 			
       	 		</h:outputText>
       	 	</f:facet>        
        </p:dataTable>

    </p:panel>  
    <p:commandButton value="Excluir"  onclick="confirmation.show()" type="button" styleClass="commandButton" />  
	<p:commandButton value="Voltar" action="#{planoBean.consultarPlano}" immediate="true" styleClass="commandButton" /> 
</h:form> 
    <p:confirmDialog id="confirmDialog" message="Excluir Plano?"  
                header="Confirmar exclusão" widgetVar="confirmation" appendToBody="true" >  
                  
        <p:commandButton id="confirm" value="Sim" oncomplete="confirmation.hide()" process="@this" 
                    action="#{planoBean.deletePlano}" />  
        <p:commandButton id="decline" value="Não" onclick="confirmation.hide()" type="button" />                     
    </p:confirmDialog>

</ui:define>
</ui:composition>
